{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "c68bbc75-16e4-44dd-bd08-7745662b150e",
   "metadata": {},
   "source": [
    "# 安装配置环境\n",
    "\n",
    "同济子豪兄 2023-8-1"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "36c6b029-d74e-4500-b6e7-68924ec531ac",
   "metadata": {},
   "source": [
    "## 安装 ONNX、ONNX Runtime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "2fa2ffd1-3748-4c7d-a06a-3ede9d435556",
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install onnx onnxruntime"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "47685389-705d-4263-8c68-0bb68751890a",
   "metadata": {},
   "source": [
    "## 安装其它第三方工具包"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "eefe2aba-e78e-43af-b84d-40ae632fbcea",
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install protobuf==3.20.1"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8d03223c",
   "metadata": {},
   "source": [
    "## 下载中文字体文件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "25e9bb05",
   "metadata": {},
   "outputs": [],
   "source": [
    "!wget https://zihao-openmmlab.obs.cn-east-3.myhuaweicloud.com/20220716-mmclassification/dataset/SimHei.ttf"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a6eafe90-54e3-40f6-a708-1e06aec4d659",
   "metadata": {},
   "source": [
    "## 验证安装配置成功"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "a407b42a-48e7-4080-bba3-98b9fb583bf3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "PyTorch 版本 1.13.1\n"
     ]
    }
   ],
   "source": [
    "import torch\n",
    "print('PyTorch 版本', torch.__version__)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "423e21e8-53d0-494d-ba7f-710a8195d493",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ONNX 版本 1.14.0\n"
     ]
    }
   ],
   "source": [
    "import onnx\n",
    "print('ONNX 版本', onnx.__version__)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "c2b0db73-74d7-40ad-a88a-8d534a316db7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ONNX Runtime 版本 1.14.1\n"
     ]
    }
   ],
   "source": [
    "import onnxruntime as ort\n",
    "print('ONNX Runtime 版本', ort.__version__)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "10798242-d86a-4945-9e5a-f823db17e344",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
